package com.scs.application.core.msg.provider;

import com.scs.application.core.msg.domain.SceneMessage;
import com.scs.application.modules.msg.handler.MessageQueue;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Component;

/**
 * @description:
 */
@Slf4j
@Component
public class SceneMsgPushProvider implements ISceneMsgPushProvider {
    @Autowired
    private ApplicationContext applicationContext;

    @Override
    public void push(SceneMessage message) {
        applicationContext.publishEvent(message);
        MessageQueue.put(message);
    }
}
